<script setup lang="ts">
defineProps(['show'])

const emit = defineEmits(['close', 'success'])

function beforeClose() {
  emit('close')
}

function getBonus() {
  apo.toast.showSuccess($t('system.success'))
  emit('success')
  beforeClose()
}
</script>

<template>
  <van-dialog
    :show="show"
    title=" "
    destroy-on-close class-name="custom-dialog"
    :show-confirm-button="false"
    :show-cancel-button="true"
    teleport="body"
    @cancel="beforeClose"
  >
    <div class="content">
      <div class="top">
        <p class="t-p1">
          {{ apo.user.currency_symbol }} 15,00
        </p>
        <p class="t-p2">
          {{ $t('home.activity_alert_text1') }}
        </p>
      </div>
      <div class="cell cell-1">
        <img src="/images/home/head/Icon_copy 1.png" alt="">
        <p class="text">
          {{ apo.user.currency_symbol }} 15,00
        </p>
        <div class="float-top">
          {{ $t('home.activity_alert_text2', ['100%']) }}
        </div>
      </div>
      <div class="cell cell-2">
        <img src="/images/home/head/Icon_copy 1 (1).png" alt="">
        <p class="text">
          {{ apo.user.currency_symbol }} 15,00
        </p>
        <div class="float-top">
          {{ $t('home.activity_alert_text3', ['100%']) }}
        </div>
      </div>
      <div class="desc">
        {{ $t('home.activity_alert_text4') }}
      </div>
      <div v-click-move class="btn" @click="getBonus">
        {{ $t('home.activity_alert_btn') }}
      </div>
    </div>
  </van-dialog>
</template>

<style scoped lang="scss">
.content {
  padding: 0.28rem;
}
.top {
  padding: 0.35rem 0 0.5rem;
  text-align: center;
  background-color: #2c1d31;
  border: 0.01rem solid var(--border-color);
  border-radius: 0.24rem;
  .t-p1 {
    font-size: 0.5rem;
    color: #fdd528;
  }
  .t-p2 {
    color: #ffbeb2;
    font-size: 0.34rem;
    margin-top: 0.5rem;
  }
}
.cell {
  height: 1rem;
  border: 0.01rem solid var(--border-color);
  background-color: #2c1d31;
  border-radius: 0.24rem;
  margin-top: 0.4rem;
  display: flex;
  justify-content: space-between;
  padding: 0 0.3rem;
  align-items: center;
  position: relative;
  img {
    width: 0.4rem;
    height: 0.4rem;
  }
  .text {
    font-size: 0.4rem;
  }
  .float-top {
    font-size: 0.28rem;
    color: #ffcef4;
    position: absolute;
    top: -0.15rem;
    left: 0.3rem;
  }
}
.cell-1 .text {
  color: #fdd528;
}
.cell-2 .text {
  color: #fd9a28;
}
.desc {
  font-size: 0.3rem;
  color: #ffcef4;
  text-align: center;
  margin-top: 0.4rem;
}
.btn {
  width: 5rem;
  background-color: #fd66b1;
  color: #fff;
  height: 1rem;
  border-radius: 1rem;
  line-height: 1rem;
  text-align: center;
  margin: 0.6rem auto 0.3rem;
  font-size: 0.48rem;
}
</style>
